﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;

/// <summary>
/// Summary description for HitCountDAL
/// </summary>
public class HitCountDAL
{
    DatabaseAccess dba = new DatabaseAccess();
	public HitCountDAL()
	{
		//
		// TODO: Add constructor logic here
		//
	}
    public void UpdateHitCounter(int counter)
    {
        SqlParameter[] paramList = new SqlParameter[2];
        paramList[0] = new SqlParameter("@hitcount",SqlDbType.Int);
        paramList[0].Value = counter;
        paramList[1] = new SqlParameter("@lastupdate",SqlDbType.DateTime);
        paramList[1].Value = DateTime.Now;
        dba.executeUpdate("proc_updateHitcount",paramList);

    }
    public DataTable GetHitCounter()
    {
        return dba.executeSelect("proc_getHitCounter");
    }

}